Chart for WPF and Silverlight > Chart Features > Data Binding > Data Series Binding > Item Name Binding |
The Item Name binding is a type of data binding used to specify the item name binding for the chart data when the ItemNameBinding property is used.
The following example calls the bindings method on the target object:
C# |
Copy Code
|
---|---|
ChartBindings bindings = new ChartBindings(); bindings.ItemNameBinding = new Binding("Name"); bindings.SeriesBindings.Add(new Binding("Input")); bindings.SeriesBindings.Add(new Binding("Output")); chart.Bindings = bindings; chart.DataContext = new InOut[] { new InOut() { Name = "n1", Input = 90, Output = 110}, new InOut() { Name = "n2", Input = 80, Output = 70}, new InOut() { Name = "n3", Input = 100, Output = 100}, }; where InOut is defined as: public class InOut { public string Name { get; set; } public double Input{ get; set;} public double Output { get; set; } } |